
int btnValue = 0;
int oldBtnValue = 0;

// Updates position and button press
// returns true if encoder value changed or button was pressed
void encUpdate()
{
	// Read values
	ENC_VALUE = rotEnc.read() / 4;
	btnValue = digitalRead(BUTTON_RESET);

	// Control button value
	if (btnValue == HIGH && oldBtnValue == LOW) {
		ENC_BTN_VALUE = HIGH;
		delay(10);
	} else ENC_BTN_VALUE = LOW;


	// Change aging values
	oldBtnValue = btnValue;
}

